/**
 * 商品相关API
 */

import {
	http,
	Method
} from "@/utils/request.js";

/**
 * 获取游戏详情
 */
export function getGameDetail(goodsId) {
	return http.request({
		url: `/game/get/${goodsId}`,
		method: Method.GET,
	});
}

/**
 * 获取游戏章节
 */
export function getGameSections(gameId) {
	return http.request({
		url: `/game/chapter/${gameId}`,
		method: Method.GET,
	});
}
/**
 * 获取魔法棒
 */
export function getChatMagic(payload) {
	return http.request({
		url: `/chat/message/magic`,
		method: Method.POST,
		needToken: true,
		data: payload
	});
}
/**
 * 获取魔法棒
 */
export function chatReload(payload) {
	return http.request({
		url: `/chat/reload`,
		method: Method.POST,
		needToken: true,
		data: payload
	});
}
/**
 * 获取游戏背包数据
 */
export function getGameGoodsList(params) {
	return http.request({
		url: `/game/goods/list`,
		method: Method.GET,
		params
	});
}

/**
 * 获取游戏内档案信息
 */
export function getGameUserInfo(goodsId) {
	return http.request({
		url: `/game/load/archive/${goodsId}`,
		method: Method.GET,
	});
}

/**
 * 游戏存档
 */
export function saveGameArchive(payload) {
	return http.request({
		url: `/game/save/archive`,
		method: Method.POST,
		needToken: true,
		data: payload,
	});
}
/**
 * 激活事件
 */
export function activeEventApi(payload) {
	return http.request({
		url: `/game/active/event`,
		method: Method.POST,
		needToken: true,
		data: payload,
	});
}


// 获取礼物列表
export function getGiftList(payload) {
	return http.request({
		url: `/game/gift/list`,
		method: Method.POST,
		needToken: true,
		data: payload,
	});
}

// 赠送礼物
export function gifGive(payload) {
	return http.request({
		url: `/game/gift/give`,
		method: Method.POST,
		needToken: true,
		data: payload,
	});
}


/**
 * 异步获取对话礼物列表
 * @param {*} gameId
 * @param {*} storyId
 * @returns
 */
export function getChatGiftList(payload) {
	return http.request({
		url: `/game/story/gift/list`,
		method: Method.POST,
		data: payload
	});
}


/**
 * 获取音游列表   
 */
export function getDanceList(gameId) {
	return http.request({
		url: `/game/dance/list/${gameId}`,
		method: Method.GET,
	});
}


/**
 * 获取音游设置   
 */
export function getDanceGameSetting() {
	return http.request({
		url: `/game/player/settings/get/playSetting`,
		method: Method.GET,
	});
}


/**
 * 保存音游设置
 */
export function saveDanceGameSetting(payload) {
	return http.request({
		url: `/game/player/settings/set/playSetting`,
		method: Method.POST,
		needToken: true,
		data: payload
	});
}


/**
 *    获取首页组件推荐列表    
 */
export function getFirstPageRecommendList(gameId) {
	return http.request({
		url: `/game/index/lists/${gameId}`,
		method: Method.GET,
	});
}

/**
 *    获取卡牌列表    
 */
export function getMyCardList(params) {
	return http.request({
		url: `/game/card/myCard/list`,
		method: Method.GET,
		params
	});
}


/**
 *    获取卡牌信息    
 */
export function getCardRoomDetail(params) {
	return http.request({
		url: `/game/card/room`,
		method: Method.GET,
		params
	});
}



/**
 *    获取卡牌详情数据   {gameId,cardId}
 */
export function getMyCardDetail(params) {
	return http.request({
		url: `/game/card/mycard`,
		method: Method.GET,
		params
	});
}


/**
 *    获取卡组乐舞列表
 */
export function getCardGroupDacneList(params) {
	return http.request({
		url: `/game/card/skillCard/list`,
		method: Method.GET,
		params
	});
}

/**
 *    获取局内道具
 */
export function getPropCardList(params) {
	return http.request({
		url: `/game/card/propCard/list`,
		method: Method.GET,
		params
	});
}



/**
 *    日理万机随机骰子
 */
export function playDice(params) {
	return http.request({
		url: `/game/index/play/dice`,
		method: Method.GET,
		params
	});
}




/**
 *   快速进入房间 返回storyId  参数：gameId
 */
export function quickParty(params) {
	return http.request({
		url: `/game/card/quick/party`,
		method: Method.GET,
		params
	});
}




/**
 *   聊天初始化  参数：gameId,roleAgentId
 */
export function chatInit(params) {
	return http.request({
		url: `/room/chat/init`,
		method: Method.GET,
		params
	})
}



/**
 *   发送消息  
 */
export function sentMessage(payload) {
	return http.request({
		url: `/room/chat/sent/message`,
		method: Method.POST,
		data: payload
	})
}



/**
 *   获取消息列表  
 */
export function getChatMessageList(params) {
	return http.request({
		url: `/room/chat/message/list`,
		method: Method.GET,
		params
	})
}



/**
 *   获取对话列表
 */
export function getChatList(params) {
	return http.request({
		url: `/room/chat/list`,
		method: Method.GET,
		params
	})
}



/**
 *   获取用户本身数值信息
 */
export function getMyInfo(params) {
	return http.request({
		url: `/game/get/myInfo`,
		method: Method.GET,
		params
	})
}

/**
 *   获取奖励中心(任务中心)数据列表
 */
export function getTaskCenterList(params) {
	return http.request({
		url: `/task/center/list`,
		method: Method.GET,
		params
	})
}


/**
 *   7日签到
 */
export function sevenDaysSign(params) {
	return http.request({
		url: `/task/7days/sign`,
		method: Method.GET,
		params
	})
}


/**
 *   领取奖励
 */
export function taskGetRewards(params) {
	return http.request({
		url: `/task/get/rewards`,
		method: Method.GET,
		params
	})
}



/**
 *   卡牌升级
 */
export function cardUpGrade(params) {
	return http.request({
		url: `/game/card/upgrade`,
		method: Method.GET,
		params
	})
}





/**
 *   获取vip数据列表
 */
export function getVipList(params) {
	return http.request({
		url: `/shop/vip/list`,
		method: Method.GET,
		params
	})
}

/**
 *   获取svip数据列表
 */
export function getSvipList(params) {
	return http.request({
		url: `/shop/svip/list`,
		method: Method.GET,
		params
	})
}

/**
 *   获取礼物列表
 */
export function getGiftListNew(params) {
	return http.request({
		url: `/shop/gift/list`,
		method: Method.GET,
		params
	})
}


/**
 *   获取礼包列表
 */
export function getGiftBoxList(params) {
	return http.request({
		url: `/shop/giftbox/list`,
		method: Method.GET,
		params
	})
}



/**
 *   获取道具列表
 */
export function getPropsList(params) {
	return http.request({
		url: `/shop/prop/list`,
		method: Method.GET,
		params
	})
}

/**
 *   获取钻石购买列表
 */
export function getPointList(params) {
	return http.request({
		url: `/shop/point/list`,
		method: Method.GET,
		params
	})
}


/**
 *   购买商品
 */
export function buyGoods(params) {
	return http.request({
		url: `/shop/goods/buy`,
		method: Method.GET,
		params
	})
}



/**
 *   获取充值列表
 */
export function getReChargeList(params) {
	return http.request({
		url: `/shop/recharge/list`,
		method: Method.GET,
		params
	})
}


/**
 *   获取分享信息
 */
export function getMyShareInfo(params) {
	return http.request({
		url: `/game/get/myShareInfo`,
		method: Method.GET,
		params
	})
}